<?php
use yii\helpers\Url;
use app\common\services\ConstantMapServices;
use app\common\services\StaticServices;
use app\common\services\UrlServices;
StaticServices::includeAppJsStatic("/js/web/account/index.js",app\assets\WebAsset::className());
?>
<div class="row  border-bottom">
    <div class="col-lg-12">
        <div class="tab_title">
            <ul class="nav nav-pills">
                <li  class="current"  >
                    <a href="/web/account/index">账户列表</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <form class="form-inline wrap_search">
            <div class="row m-t p-w-m">
                <div class="form-group">
                    <select name="status" class="form-control inline">
                        <option value="<?php echo ConstantMapServices::$status_default;?>">请选择状态</option>
                        <?php foreach ($status_mapping as $_status=>$title):?>
                        <option value="<?php echo $_status;?>" <?php if($_status==$search_condition['status']):?>selected<?php endif;?>><?php echo $title;?></option>
                        <?php endforeach;?>
                    </select>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <input type="text" name="mix_kw" placeholder="请输入姓名或者手机号码" class="form-control" value="<?php echo $search_condition['mix_kw']?>">
                        <input type="hidden" name="p" value="1">
                        <span class="input-group-btn">
                    <button type="button" class="btn btn-primary search">
                        <i class="fa fa-search"></i>搜索
                    </button>
                </span>
                    </div>
                </div>
            </div>
            <hr/>
            <div class="row">
                <div class="col-lg-12">
                    <a class="btn btn-w-m btn-outline btn-primary pull-right" href="/web/account/set">
                        <i class="fa fa-plus"></i>账号
                    </a>
                </div>
            </div>
        </form>
        <table class="table table-bordered m-t">
            <thead>
                <tr>
                    <th>序号</th>
                    <th>姓名</th>
                    <th>手机</th>
                    <th>邮箱</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            <?php foreach($lists as $list):?>
                <tr>
                    <td><?php echo $list['uid'];?></td>
                    <td><?php echo $list['nickname'];?></td>
                    <td><?php echo $list['mobile'];?></td>
                    <td><?php echo $list['email'];?></td>
                    <td>
                        <a  href="<?php echo Url::to(['/web/account/info','id'=>$list['uid']]);?>">
                            <i class="fa fa-eye fa-lg"></i>
                        </a>
                        <a class="m-l" href="<?php echo Url::to(['/web/account/set','id'=>$list['uid']]);?>">
                            <i class="fa fa-edit fa-lg"></i>
                        </a>

                        <?php if($list['status']):?>
                        <a class="m-l remove" href="javascript:void(0);" data="<?php echo $list['uid'];?>">
                            <i class="fa fa-trash fa-lg"></i>
                        </a>
                        <?php else:?>
                        <a class="m-l recover" href="javascript:void(0);" data="<?php echo $list['uid'];?>">
                            <i class="fa fa-rotate-left fa-lg"></i>
                        </a>
                        <?php endif;?>
                    </td>
                </tr>
            <?php endforeach;?>
            </tbody>
        </table>
        <div class="row">
            <div class="col-lg-12">
                <span class="pagination_count" style="line-height: 40px;">共<?php echo $pages['total_count'];?>条记录 | 每页<?php echo $pages['page_size'];?>条</span>
                <ul class="pagination pagination-lg pull-right" style="margin: 0 0 ;">
                    <?php for($_page=1;$_page<=$pages['total_page'];$_page++):?>
                    <?php if($_page==$pages['p']):?>
                    <li class="active">
                        <a href="<?=UrlServices::buildNullUrl();?>"><?php echo $_page;?></a>
                    </li>
                    <?php else:?>
                    <li>
                        <a href="<?=UrlServices::buildWebUrl('/account/index',['p'=>$_page]);?>"><?php echo $_page;?></a>
                    </li>
                    <?php endif;?>
                    <?php endfor;?>
                </ul>
            </div>
        </div>	
    </div>
</div> 



